package com.june.junemplayer.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.june.junemplayer.view.MainActivity;

public class InitReceiver extends BroadcastReceiver {
    public static final String DATA_INIT = "android.intent.action.initReceiver.dataInit";
    public static final String VIEW_INIT = "android.intent.action.initReceiver.viewInit";

    private static int flag = 0;

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(DATA_INIT)) {
            flag++;
        } else if (intent.getAction().equals(VIEW_INIT)) {
            flag++;
        }
        if (flag == 2) {
            context.startActivity(new Intent(context, MainActivity.class));
        }

    }
}
